<?php

namespace SLN0002\Controller;

use Home\Common\FIdConst;
use Home\Controller\PSIBaseController;
use Home\Service\UserService;

/**
 * 财务报表Controller
 *
 * @author PSI
 * @copyright 2015 - present
 * @license GPL v3
 */
class ReportController extends PSIBaseController
{
  /**
   * 资产负债表 - 主页面
   * 
   * 模板页面：web\Application\SLN0002\View\Report\index01.html
   */
  public function index01()
  {
    $us = new UserService();

    if ($us->hasPermission(FIdConst::GL_REPORT_01)) {
      $this->initVar();

      $this->assign("title", "资产负债表");

      $this->display();
    } else {
      $this->gotoLoginPage("/SLN0002/Report/index01");
    }
  }

  /**
   * 利润表 - 主页面
   * 
   * 模板页面：web\Application\SLN0002\View\Report\index02.html
   */
  public function index02()
  {
    $us = new UserService();

    if ($us->hasPermission(FIdConst::GL_REPORT_02)) {
      $this->initVar();

      $this->assign("title", "利润表");

      $this->display();
    } else {
      $this->gotoLoginPage("/SLN0002/Report/index02");
    }
  }

  /**
   * 所有者权益变动表 - 主页面
   * 
   * 模板页面：web\Application\SLN0002\View\Report\index03.html
   */
  public function index03()
  {
    $us = new UserService();

    if ($us->hasPermission(FIdConst::GL_REPORT_03)) {
      $this->initVar();

      $this->assign("title", "所有者权益变动表");

      $this->display();
    } else {
      $this->gotoLoginPage("/SLN0002/Report/index03");
    }
  }

  /**
   * 现金流量表 - 主页面
   * 
   * 模板页面：web\Application\SLN0002\View\Report\index04.html
   */
  public function index04()
  {
    $us = new UserService();

    if ($us->hasPermission(FIdConst::GL_REPORT_04)) {
      $this->initVar();

      $this->assign("title", "现金流量表");

      $this->display();
    } else {
      $this->gotoLoginPage("/SLN0002/Report/index04");
    }
  }
}
